package com.ruoyi.seal.service.impl;

import java.util.List;

import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.seal.service.ISealService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.seal.mapper.SealJyMapper;
import com.ruoyi.seal.domain.SealJy;
import com.ruoyi.seal.service.ISealJyService;

/**
 * 简单用印Service业务层处理
 *
 * @author zy
 * @date 2022-11-17
 */
@Service
public class SealJyServiceImpl implements ISealJyService
{
    @Autowired
    private SealJyMapper sealJyMapper;


    @Autowired
    private RedisCache redisCache;

    /**
     * 查询简单用印
     *
     * @param sealId 简单用印主键
     * @return 简单用印
     */
    @Override
    public SealJy selectSealJyBySealId(String sealId, Long userId)
    {
        return sealJyMapper.selectSealJyBySealId(sealId,userId);
    }

    /**
     * 查询简单用印列表
     *
     * @param sealJy 简单用印
     * @return 简单用印
     */
    @Override
    public List<SealJy> selectSealJyList(SealJy sealJy)
    {
        return sealJyMapper.selectSealJyList(sealJy);
    }

    /**
     * 新增简单用印
     *
     * @param sealJy 简单用印
     * @return 结果
     */
    @Override
    public int insertSealJy(SealJy sealJy)
    {
        //流水号自增ID设置
        sealJy.setSealId(IdUtils.serialNumber("JY", redisCache, ISealService.class));
        return sealJyMapper.insertSealJy(sealJy);
    }

    /**
     * 修改简单用印
     *
     * @param sealJy 简单用印
     * @return 结果
     */
    @Override
    public int updateSealJy(SealJy sealJy)
    {
        return sealJyMapper.updateSealJy(sealJy);
    }

    /**
     * 批量删除简单用印
     *
     * @param sealIds 需要删除的简单用印主键
     * @return 结果
     */
    @Override
    public int deleteSealJyBySealIds(String[] sealIds)
    {
        return sealJyMapper.deleteSealJyBySealIds(sealIds);
    }

    /**
     * 删除简单用印信息
     *
     * @param sealId 简单用印主键
     * @return 结果
     */
    @Override
    public int deleteSealJyBySealId(String sealId)
    {
        return sealJyMapper.deleteSealJyBySealId(sealId);
    }


}
